/* Custom Project and Libraries Copyright, 2011.  Emile, TP */

using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Mail;
using System.Net;


namespace SendMail
{
    class Program
    {
        static void Main()
        {
	   

            // Configure mail client
            SmtpClient mailClient = new SmtpClient("smtp.mail.yahoo.com");
            // Set username and password (for SMTP servers that require authentication)
            mailClient.Credentials = new NetworkCredential("Bluesearchmail@yahoo.com", "1234567");

            // Create the mail message
            MailMessage mailMessage = new MailMessage("Bluesearchmail@yahoo.com", "weewenjie@gmail.com", "Email Title/Subject here", "Email Body here");
            // Body can now contain HTML tags eg <br>
	    mailMessage.IsBodyHtml = true;
            
	    //send the e-mail   
	    try { mailClient.Send(mailMessage); }
            catch { }
           
	    //Yahoo accounts work. I did try with a gmail account and it will not work.

        }
    }
}
